package com.netistate.dao;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.netistate.base.BaseDao;
import com.netistate.pojo.ProjectBlog;

@Repository
public class ProjectBlogDao extends BaseDao<ProjectBlog, Integer>{

	/**
	 * 根据项目id去找Blog
	 * @param pid
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public List<ProjectBlog> findAllProjectBlogByPid(int pid) {
		String hql = "from ProjectBlog where project = " + pid;
		Query query = getSession().createQuery(hql);
		return query.list();
	}

}
